/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.ka.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.kaaction.common.persistence.DataEntity;
import com.kaaction.common.utils.excel.annotation.ExcelField;

/**
 * 货品入库明细Entity
 * @author huanghaiming
 * @version 2017-06-21
 */
public class ProductInstockDetail extends DataEntity<ProductInstockDetail> {
	
	private static final long serialVersionUID = 1L;
	private String categoryId;		// 品类
	private String supplierId;		// 供应商
	private String productCode;		// 货号
	private Date instockDate;		// 入库时间
	private String sizeId;		// 尺码
	private String colorId;		// 颜色
	private Integer num;		// 数量
	private Double price;		// 入库价格
	private String salesprice;		// 销售价格
	private String gridNo;		// 库位号
	private String state;		// 状态
	private String condition;		// 状态1
	
	private String categoryName;		// 品类名称
	private String supplierName;		// 供应商名称
	private String sizeName;		// 尺码名称
	private String colorName;		// 颜色名称
	
	private Date startDate;//开始日期
	private Date endDate;//结束日期
	
	public ProductInstockDetail() {
		super();
	}

	public ProductInstockDetail(String id){
		super(id);
	}

	@Length(min=1, max=64, message="品类长度必须介于 1 和 64 之间")
	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}
	
	@Length(min=1, max=64, message="供应商长度必须介于 1 和 64 之间")
	public String getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(String supplierId) {
		this.supplierId = supplierId;
	}
	
	@Length(min=1, max=64, message="货号长度必须介于 1 和 64 之间")
	@ExcelField(title="货号", align=2, sort=4)
	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="入库时间不能为空")
	public Date getInstockDate() {
		return instockDate;
	}

	public void setInstockDate(Date instockDate) {
		this.instockDate = instockDate;
	}
	
	@Length(min=1, max=64, message="尺码长度必须介于 1 和 64 之间")
	public String getSizeId() {
		return sizeId;
	}

	public void setSizeid(String sizeId) {
		this.sizeId = sizeId;
	}
	
	@Length(min=1, max=64, message="颜色长度必须介于 1 和 64 之间")
	public String getColorId() {
		return colorId;
	}

	public void setColorid(String colorId) {
		this.colorId = colorId;
	}
	
	@ExcelField(title="入库件数", align=2, sort=12)
	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}
	
	@ExcelField(title="入库件数", align=2, sort=14)
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	public String getSalesprice() {
		return salesprice;
	}

	public void setSalesprice(String salesprice) {
		this.salesprice = salesprice;
	}
	
	@Length(min=0, max=32, message="库位号长度必须介于 0 和 32 之间")
	@ExcelField(title="货架", align=2, sort=16)
	public String getGridNo() {
		return gridNo;
	}

	public void setGridNo(String gridNo) {
		this.gridNo = gridNo;
	}
	
	@Length(min=1, max=4, message="状态长度必须介于 1 和 4 之间")
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	@ExcelField(title="状态", align=2, sort=50)
	public String getCondition() {
		String str = "";
		if("0".equals(condition)){
			str = "正常入库";
		}else if("6".equals(condition)){
			str = "退货（非残次品）";
		}else if("7".equals(condition)){
			str = "退货（残次品）";
		}else{
			str = "未知";
		}
		return str;
	}

	public void setCondition(String condition) {
		this.condition = condition;
	}

	@ExcelField(title="品类", align=2, sort=2)
	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	@ExcelField(title="供应商", align=2, sort=6)
	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	@ExcelField(title="尺码", align=2, sort=8)
	public String getSizeName() {
		return sizeName;
	}

	public void setSizeName(String sizeName) {
		this.sizeName = sizeName;
	}

	@ExcelField(title="颜色", align=2, sort=10)
	public String getColorName() {
		return colorName;
	}

	public void setColorName(String colorName) {
		this.colorName = colorName;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	
}